package Dominio;

import java.util.List;



public class Sensor {
	private int ID;
	private String descripcion;
	private boolean on;
	private List<Medida>lM;
	
	public Sensor(){
	}

	public Sensor(int ID, String descripcion, boolean on,
			List<Medida> lM) {
		this.ID = ID;
		this.descripcion = descripcion;
		this.on = on;
		this.lM = lM;
	}

	public int getID() {
		return ID;
	}

	public void setIdSensor(int ID) {
		this.ID = ID;
	}

	public String getDescripcion() {
		return descripcion;
	}

	public void setDescripcion(String descripcion) {
		this.descripcion = descripcion;
	}

	public boolean isOn() {
		return on;
	}

	public void setOn(boolean on) {
		this.on = on;
	}

	public List<Medida> getlM() {
		return lM;
	}

	public void setlM(List<Medida> lM) {
		this.lM = lM;
	}
	
	public String socketFormat(){
		return ((ID<10)?"0":"") +ID+";"+descripcion+";"+((on)?"ON":"OFF");
	}
	
	public String toString(){
		return ((ID<10)?"0":"") +ID+" "+descripcion;
	}
	
	
}
